/**
 *
#[derive(serde::Serialize, Default, serde::Deserialize)]
pub struct BattleValueExt {
    pub author: Option<String>,
    // 生成时间
    pub time: String,
    pub kill_count: i32,
    pub death_count: i32,
    //总输出 数字可能比较大
    pub total_damage: String,
    pub total_receive: String,
    // 敌人数量
    pub enemy_count: i32,
    pub total: i32,
}

// #[derive(serde::Serialize, Default)]
// pub struct TimeLineData {
//     pub time: String,
//     pub damage: i32,
//     pub receive: i32,
// }

// 人名，职业，输出，承受
#[derive(serde::Serialize, Default, Clone, serde::Deserialize)]
pub struct BattleValueExt2 {
    pub name: String,
    pub role: String,
    // 敌对
    pub enemy: bool,
    pub damage: i32,
    pub receive: i32,
    // 计数
    pub count: i32,
}

// 声明返回对像
#[derive(serde::Serialize, Default, serde::Deserialize)]
pub struct AnalysisResult {
    pub top30_battle_damage: Vec<BattleValue>,
    pub top30_battle_receive: Vec<BattleValue>,
    pub sumary: BattleValueExt,
    // 造成人员 伤害 name val
    // pub damage_target: Vec<BattleValue>,
    // pub receive_target: Vec<BattleValue>,
    // // 技能
    // pub damage_skill: Vec<BattleValue>,
    // pub receive_skill: Vec<BattleValue>,

    // 所有人员名字
    pub whole_user: Vec<BattleValueExt2>,

    // pub whole_skill: Vec<BattleValueExt2>,
    pub skills_damage: Vec<BattleValueExt2>,
    pub skills_receive: Vec<BattleValueExt2>,
    // 时间，输出/承受伤害
    pub time_line: Vec<BattleValueExt2>,
    // 击杀时间线
    pub time_killer: Vec<BattleValueExt2>,
}
 */

export interface BattleValueExt {
  author?: string
  time: string
  time_range: string
  time_range_start: string
  time_range_end: string
  kill_count: number
  death_count: number
  total_damage: string
  total_receive: string
  enemy_count: number
  total: number
}

export interface BattleValueExt2 {
  name: string
  role: string
  enemy: boolean
  damage: number
  receive: number
  count: number
}

export interface RadarData {
  id: number
  title: string
  author: string
  role: string
  damage: number
  receive: number
  kills: number
  deaths: number
  buff_damage: number
  buff_receive: number
  duration: number
  wash_count: number
  wash_receive: number
  heal_count: number
  heal_receive: number
  enemy_count: number
  total_count: number
  max_kill: number
}

export interface AnalysisResult {
  top30_battle_damage: BattleValue[]
  top30_battle_receive: BattleValue[]
  sumary: BattleValueExt
  whole_user: BattleValueExt2[]
  skills_damage: BattleValueExt2[]
  skills_receive: BattleValueExt2[]
  skills_buff: BattleValueExt2[]
  time_line: BattleValueExt2[]
  time_killer: BattleValueExt2[]
  kill_death: BattleValueExt2[]
  buffer_data: BattleValue[]
  radar_data: RadarData
}

export interface BattleValue {
  time: string
  time_s: string
  action: string
  skill: string
  target: string
  value: number
  extra?: string
}

export interface NameValueLength {
  name: string
  value: number
  length: number
}
